package com.roc.steelend.service.Impl;

import com.roc.steelend.mapper.CompanyMoneyMapper;
import com.roc.steelend.service.CompanyMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class CompanyMoneyServiceImpl  implements CompanyMoneyService {

    @Autowired
    private CompanyMoneyMapper companyMoneyMapper;
    @Override
    public List<HashMap<String, Object>> findAllCompanyMoneyDetail() {
        return companyMoneyMapper.findAllCompanyMoneyDetail();
    }


    @Override
    public List<HashMap<String, Object>> findCompanymoneyDetail(Integer allCompanyMoneyId, Integer currentPage, Integer pageSize) {

        currentPage=(currentPage-1)*pageSize;

        return companyMoneyMapper.findCompanymoneyDetail(allCompanyMoneyId,currentPage,pageSize);
    }




    @Override
    public Integer findCompanymoneyDetailCount(Integer allCompanyMoneyId) {
        return companyMoneyMapper.findCompanymoneyDetailCount(allCompanyMoneyId);
    }
}
